class HomeDetail {
  int flag;
  String buttonFlag;
  int count;
  String message;
  Data data;

  HomeDetail({this.flag, this.buttonFlag, this.count, this.message, this.data});

  HomeDetail.fromJson(Map<String, dynamic> json) {
    flag = json['flag'];
    buttonFlag = json['buttonFlag'];
    count = json['count'];
    message = json['message'];
    data = json['data'] != null ? new Data.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['flag'] = this.flag;
    data['buttonFlag'] = this.buttonFlag;
    data['count'] = this.count;
    data['message'] = this.message;
    if (this.data != null) {
      data['data'] = this.data.toJson();
    }
    return data;
  }
}

class Data {
  String commodityName;
  String commodityId;
  String lessonPackageFlag;
  int totalLessonNum;
  String favouredPrice;
  double price;
  String remark;
  int purchaseNumber;
  SourceCode sourceCode;
  int sourceId;
  String pcIconInfo;
  String pcDetailIconInfo;
  String currentVersion;
  String iapProductId;
  String teacherId;
  String teacherName;
  String headImageUrl;
  String mottoInfo;
  String introduce;
  String promotionPrice;
  String promotionDate;
  int expireDay;
  String redirectThirdPayFlag;
  String thirdPayUrl;
  String remainingNumber;
  int companyId;
  String bookContain;
  String agreementId;
  String agreementName;
  String courseSubject;
  int firstProductId;
  int secondProductId;
  String studyCLassin;
  String classHours;
  String lessonChargeFlag;
  String surplusLessonNumFlag;
  String surplusLessonNum;
  String lessonPrice;
  String minPrice;

  Data(
      {this.commodityName,
        this.commodityId,
        this.lessonPackageFlag,
        this.totalLessonNum,
        this.favouredPrice,
        this.price,
        this.remark,
        this.purchaseNumber,
        this.sourceCode,
        this.sourceId,
        this.pcIconInfo,
        this.pcDetailIconInfo,
        this.currentVersion,
        this.iapProductId,
        this.teacherId,
        this.teacherName,
        this.headImageUrl,
        this.mottoInfo,
        this.introduce,
        this.promotionPrice,
        this.promotionDate,
        this.expireDay,
        this.redirectThirdPayFlag,
        this.thirdPayUrl,
        this.remainingNumber,
        this.companyId,
        this.bookContain,
        this.agreementId,
        this.agreementName,
        this.courseSubject,
        this.firstProductId,
        this.secondProductId,
        this.studyCLassin,
        this.classHours,
        this.lessonChargeFlag,
        this.surplusLessonNumFlag,
        this.surplusLessonNum,
        this.lessonPrice,
        this.minPrice});

  Data.fromJson(Map<String, dynamic> json) {
    commodityName = json['commodityName'];
    commodityId = json['commodityId'];
    lessonPackageFlag = json['lessonPackageFlag'];
    totalLessonNum = json['totalLessonNum'];
    favouredPrice = json['favouredPrice'];
    price = json['price'];
    remark = json['remark'];
    purchaseNumber = json['purchaseNumber'];
    sourceCode = json['sourceCode'] != null
        ? new SourceCode.fromJson(json['sourceCode'])
        : null;
    sourceId = json['sourceId'];
    pcIconInfo = json['pcIconInfo'];
    pcDetailIconInfo = json['pcDetailIconInfo'];
    currentVersion = json['currentVersion'];
    iapProductId = json['iapProductId'];
    teacherId = json['teacherId'];
    teacherName = json['teacherName'];
    headImageUrl = json['headImageUrl'];
    mottoInfo = json['mottoInfo'];
    introduce = json['introduce'];
    promotionPrice = json['promotionPrice'];
    promotionDate = json['promotionDate'];
    expireDay = json['expireDay'];
    redirectThirdPayFlag = json['redirectThirdPayFlag'];
    thirdPayUrl = json['thirdPayUrl'];
    remainingNumber = json['remainingNumber'];
    companyId = json['companyId'];
    bookContain = json['bookContain'];
    agreementId = json['agreementId'];
    agreementName = json['agreementName'];
    courseSubject = json['courseSubject'];
    firstProductId = json['firstProductId'];
    secondProductId = json['secondProductId'];
    studyCLassin = json['studyCLassin'];
    classHours = json['classHours'];
    lessonChargeFlag = json['lessonChargeFlag'];
    surplusLessonNumFlag = json['surplusLessonNumFlag'];
    surplusLessonNum = json['surplusLessonNum'];
    lessonPrice = json['lessonPrice'];
    minPrice = json['minPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['commodityName'] = this.commodityName;
    data['commodityId'] = this.commodityId;
    data['lessonPackageFlag'] = this.lessonPackageFlag;
    data['totalLessonNum'] = this.totalLessonNum;
    data['favouredPrice'] = this.favouredPrice;
    data['price'] = this.price;
    data['remark'] = this.remark;
    data['purchaseNumber'] = this.purchaseNumber;
    if (this.sourceCode != null) {
      data['sourceCode'] = this.sourceCode.toJson();
    }
    data['sourceId'] = this.sourceId;
    data['pcIconInfo'] = this.pcIconInfo;
    data['pcDetailIconInfo'] = this.pcDetailIconInfo;
    data['currentVersion'] = this.currentVersion;
    data['iapProductId'] = this.iapProductId;
    data['teacherId'] = this.teacherId;
    data['teacherName'] = this.teacherName;
    data['headImageUrl'] = this.headImageUrl;
    data['mottoInfo'] = this.mottoInfo;
    data['introduce'] = this.introduce;
    data['promotionPrice'] = this.promotionPrice;
    data['promotionDate'] = this.promotionDate;
    data['expireDay'] = this.expireDay;
    data['redirectThirdPayFlag'] = this.redirectThirdPayFlag;
    data['thirdPayUrl'] = this.thirdPayUrl;
    data['remainingNumber'] = this.remainingNumber;
    data['companyId'] = this.companyId;
    data['bookContain'] = this.bookContain;
    data['agreementId'] = this.agreementId;
    data['agreementName'] = this.agreementName;
    data['courseSubject'] = this.courseSubject;
    data['firstProductId'] = this.firstProductId;
    data['secondProductId'] = this.secondProductId;
    data['studyCLassin'] = this.studyCLassin;
    data['classHours'] = this.classHours;
    data['lessonChargeFlag'] = this.lessonChargeFlag;
    data['surplusLessonNumFlag'] = this.surplusLessonNumFlag;
    data['surplusLessonNum'] = this.surplusLessonNum;
    data['lessonPrice'] = this.lessonPrice;
    data['minPrice'] = this.minPrice;
    return data;
  }
}

class SourceCode {
  String itemCode;
  String itemValue;
  String type;

  SourceCode({this.itemCode, this.itemValue, this.type});

  SourceCode.fromJson(Map<String, dynamic> json) {
    itemCode = json['itemCode'];
    itemValue = json['itemValue'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['itemCode'] = this.itemCode;
    data['itemValue'] = this.itemValue;
    data['type'] = this.type;
    return data;
  }
}

